{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "如何查询字典 2.通过字典的方法实现字典的修改（如：增、删、修改）\n",
    "\n",
    "# 新建字典 dict_name - {key1:value1,key2:vale]ue2}\n",
    "stu_info = {\n",
    "    \"stu1801\":\"Liu\",\n",
    "    \"stu1802\":\"Jia\",\n",
    "    \"stu1803\":\"Qi\"\n",
    "}\n",
    "print(type(stu_info),'\\n',stu_info)\n",
    "<class 'dict'>\n",
    " {'stu1801': 'Liu', 'stu1802': 'Jia', 'stu1803': 'Qi'}\n",
    "\n",
    "word = input(\"请输入要查询的文本：\")\n",
    " # -*- coding:utf-8 -*-\n",
    " # Author:Zhichao\n",
    "\n",
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "word = input(\"Provide a word to search for vowels:\")\n",
    "found = {}\n",
    "\n",
    " # found[\"a\"]=0\n",
    "# found[\"e\"]=0\n",
    " # found[\"i\"]=0\n",
    " # found[\"o\"]=0\n",
    " # found[\"u\"]=0\n",
    "found = found.fromkeys(vowels,0)\n",
    "for letter in word:\n",
    "    if letter in vowels:\n",
    "         found[letter] += 1\n",
    "\n",
    " # print(found.items())\n",
    "for k,v in found.items():\n",
    "     print(k,\"was found\",v,\"time(s)\")\n",
    " # print(found)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}